<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<link th:href="@{/ajax/libs/jquery-ztree/3.5/css/metro/zTreeStyle.css}"
	rel="stylesheet" />
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-label-add">
			<div class="form-group">
				<div class="col-sm-8">
					<input class="form-control" type="text" name="label" placeholder="标签名称"/>
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-8">
					<input class="form-control" type="text" name="remark" placeholder="备注" />
				</div>
			</div>
		</form>
	</div>
	<div th:include="include::footer"></div>
	<script
		th:src="@{/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js}"></script>
	<script type="text/javascript">
		function submitHandler() {
	        if ($.validate.form()) {
	        	add();
	        }
	    }
		function add(){
        	var label = $("input[name='label']").val();
			var remark = $("input[name='remark']").val();
			$.ajax({
				cache : true,
				type : "POST",
				url : ctx + "phone/add",
				data : {
                    "label": label,
					"remark": remark
				},
				async : false,
				error : function(request) {
					$.modal.alertError("系统错误");
				},
				success : function(data) {
					$.operate.successCallback(data);
				}
			});
		}
	</script>
</body>
</html>
